import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

// 导入组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import PersonContainer from './components/tabbar/PersonContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'

var router = new VueRouter({
    routes: [
        // 重定向
        {path: '/', redirect: '/home'},
        {path: '/home', component: HomeContainer},
        {path: '/person', component: PersonContainer},
        {path: '/shopcar', component: ShopcarContainer},
        {path: '/search', component: SearchContainer},
        {path: '/home/newslist', component: NewsList},
        {path: '/home/newsinfo', component: NewsInfo},

    ],
    linkActiveClass: 'mui-active'
});

//将对象暴漏出去
export default router;